import request from "@/utils/request";
/**
 * 获取赛事列表信息
 * @param params
 * @returns {*}
 */
export function getList(params) {
  return request({
    url: "/league/competition/getCompetitionList",
    method: "get",
    params: params,
  });
}

/**
 * 赛事置顶
 * @param id
 * @returns {*}
 */
export function overhead(id) {
  return request({
    url: "/league/competition/top/" + id,
    method: "put",
    data: id,
  });
}

/**
 * 取消置顶
 * @param id
 * @returns {*}
 */
export function cancel(id) {
  return request({
    url: "/league/competition/unTop/" + id,
    method: "put",
    data: id,
  });
}

/**
 * 发布赛事
 * @param id
 * @returns {*}
 */
export function publish(data) {
  return request({
    url: "/league/competition/enable/" + data.id,
    method: "put",
    data: data,
  });
}

/**
 * 取消发布
 * @param param
 * @returns {*}
 */
export function disqualification(data) {
  return request({
    url: "/league/competition/disable/" + data.id,
    method: "put",
    data,
  });
}

/**
 * 删除
 * @param data
 * @returns {*}
 */
export function delApi(data) {
  return request({
    url: "/league/competition/" + data.ids,
    method: "delete",
    data,
  });
}
// 设置
export function getSetting(params) {
  return request({
    url: `/league/competitionLabel/cptLabelList`,
    method: "get",
    params: params,
  });
}

export function editSetting(data) {
  return request({
    url: `/league/competitionLabel/editCptCustomInfo`,
    method: "put",
    data: data,
  });
}
export function addSetting(data) {
  return request({
    url: `/league/competitionLabel/addCptCustomInfo`,
    method: "post",
    data: data,
  });
}
export function delSetting(data) {
  return request({
    url: `/league/competitionLabel/${data.ids}`,
    method: "delete",
  })
}
// 联赛审核列表
export function listByLeagueId(params) {
  return request({
    url: "/league/competition/CptSignerListByLeagueId",
    method: "get",
    params
  })
}
export function getMiniappQrCode(id, type) {
  return request({
    url: `/league/competition/getMiniappQrCode/${id}?type=${type}`,
    method: 'get'
  })
}
